{include file='public/head'}
<body>
<style type="text/css" media="screen">
    header {
        color: black;
    }

    .layui-form-label {
        width: 150px;
    }

    .layui-input-block {
        margin-left: 180px
    }
</style>


<div class="x-body">
    <form class="layui-form" id='mainForm' method="post" action="batch">

        <div class="layui-form-item">
            <label class="layui-form-label">Seller ID</label>
            <div class="layui-input-block">
                <input type="text" id="seller_id" name="seller_id" autocomplete="off" value="{$store.seller_id}"
                       class="layui-input" lay-verify="required">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">MWS Auth Token</label>
            <div class="layui-input-block">
                <input type="text" id="mws_auth_token" name="mws_auth_token" autocomplete="off"
                       value="{$store.mws_auth_token}" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">AWS Access Key ID</label>
            <div class="layui-input-block">
                <input type="text" id="aws_access_key" name="aws_access_key" autocomplete="off" class="layui-input"
                       value="{$store.aws_access_key}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Secret Key</label>
            <div class="layui-input-block">
                <input type="text" id="secret_key" name="secret_key" autocomplete="off" class="layui-input"
                       value="{$store.secret_key}">
            </div>
        </div>

        <div class="layui-form-item">
            <div>
                <button style="width: 100%" class="layui-btn" lay-submit="" lay-filter="toSubmit">提交保存</button>
            </div>
        </div>

    </form>
</div>
</body>
{include file='public/foot'}
<script type="text/javascript">

    $(document).ready(function () {
        var form = layui.form;
        var layer = layui.layer;
        var options = {
            type: 'post',           //post提交
            dataType: "json",        //json格式
            data: {},    //如果需要提交附加参数，视情况添加
            clearForm: false,        //成功提交后，清除所有表单元素的值
            resetForm: false,        //成功提交后，重置所有表单元素的值
            cache: false,
            async: false,          //同步返回
            success: function (data) {
                if (data.code == 0) {
                    layer.msg(data.msg);
                } else {
                    layer.msg(data.msg, {icon: 1, time: 500}, function () {
                        $("#reset").click();
                        x_admin_close();
                        parent.location.reload();
                    });
                }
                //服务器端返回处理逻辑
            },
            error: function (XmlHttpRequest, textStatus, errorThrown) {
                layer.msg('操作失败:服务器处理失败');
            }
        };

        // bind form using 'ajaxForm'
        $('#mainForm').ajaxForm(options).submit(function (data) {
        });
    });
</script>
</html>
